package com.klm.common.config.bean;

import lombok.Setter;

@Setter
public class DatabaseConfig {

    /**
     * 缺省配置时默认 数据库类型
     */
    private static final String defaultType = "mariadb";

    /**
     * 缺省配置时默认 自动部署为关闭
     */
    private static final Boolean defaultAutoDeploymentEnabled = false;

    /**
     * # 数据库类型 mariadb/mysql/postgresql
     */
    private String type;

    /**
     * 自动部署开关
     */
    private Boolean auto_deployment_enabled;

    /**
     * 数据源 key
     */
    private String key;

    public String getType() {
        return type == null ? defaultType : type;
    }

    public Boolean auto_deployment_enabled() {
        return auto_deployment_enabled == null ? defaultAutoDeploymentEnabled : auto_deployment_enabled;
    }

    public String getKey() {
        return key == null ? "" : key;
    }

    public String defaultType() {
        return defaultType;
    }

    public Boolean defaultAutoDeploymentEnabled() {
        return defaultAutoDeploymentEnabled;
    }
}
